<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <SCript>
        class Myclass{
            #pri(){
                console.log("这是私有方法")
            }
            pub(){
                //在内部调用私有方法
                this.#pri();
            }
        }
        let myobject=new Myclass()
       // myobject.pri()//无法访问
        myobject.pub()

    </SCript>
</body>
</html>